import request from "@/utils/request";

// 获得全部管理员信息
export const getAllAdmin = value =>{
    return request({
        url:'/admin/getAllAdmin',
        method:'get',
        params:value
    })
}

// 管理员登录
export const login = value =>{
    return request({
        url:'/admin/login',
        method:'post',
        data:value
    })
}


// 用户和登录
export const userLogin = value =>{
    return request({
        url:'/user/login',
        method:'post',
        data:value
    })
}

// 获得用户信息分页
export const getAdminPage = value =>{
    return request({
        url:'/admin/getAdminPage',
        method:'get',
        params:value
    })
}


// 添加管理员
export const addAdmin = value =>{
    return request({
        url:'/admin/addAdmin',
        method:'post',
        data:value
    })
}


// 获得全部用户信息
export const getAllUser = value =>{
    return request({
        url:'/user/getAllUser',
        method:'get',
        params:value
    })
}

// 获得分页用户信息
export const getUserPage = value =>{
    return request({
        url:'/user/getUserPage',
        method:'get',
        params:value
    })
}
// 判断用户注册手机号是都存在
export const phoneIsExist = value =>{
    return request({
        url:'/user/phoneIsExist',
        method:'get',
        params:value
    })
}


// 根据id删除用户
export const deleteUserById = value =>{
    return request({
        url:'/user/deleteUserById/'+value,
        method:'delete',
        date:value
    })
}


// 根据id删除用户
export const uploadImage = value =>{
    return request({
        url:'/file/upload',
        method:'post',
        data:value,
        headers: {
            "Content-Type":"multipart/form-data"
        }
    })
}


// 根据id删除用户
export const addNotice = value =>{
    return request({
        url:'/notice/addNotice',
        method:'post',
        data:value,
    })
}



// 根据id删除用户
export const getNoticeByPage = value =>{
    return request({
        url:'/notice/getNoticeByPage',
        method:'get',
        params:value
    })
}



export const getAllNotice = value =>{
    return request({
        url:'/notice/getAllNotice',
        method:'get',
        params:value
    })
}



// 根据id查询公告
export const getNoticeById = value =>{
    return request({
        url:'/notice/getNoticeById/' +value,
        method:'get',
        data:value
    })
}



// 根据id修改公告
export const updateNotice = value =>{
    return request({
        url:'/notice/updateNotice',
        method:'put',
        data:value,
    })
}


// 根据id修改公告
export const addActivity = value =>{
    return request({
        url:'/activity/addActivity',
        method:'post',
        data:value,
    })
}


// 分页日常活动
export const getEverydayActivityByPage = value =>{
    return request({
        url:'/activity/getEverydayActivityByPage',
        method:'get',
        params:value
    })
}

// 分页所有志愿者活动
export const getAllVolunteerActivity = value =>{
    return request({
        url:'/activity/getAllVolunteerActivity',
        method:'get',
        params:value
    })
}

// 分页所有志愿者活动
export const getAllEverydayActivity = value =>{
    return request({
        url:'/activity/getAllEverydayActivity',
        method:'get',
        params:value
    })
}

// 分页志愿者活动
export const getVolunteerActivityByPage = value =>{
    return request({
        url:'/activity/getVolunteerActivityByPage',
        method:'get',
        params:value
    })
}


export const getRegistrationByActivityId = value =>{
    return request({
        url:'/registration/getRegistrationByActivityId',
        method:'get',
        params:value
    })
}

export const getRegistrationByDate = value =>{
    return request({
        url:'/registration/getRegistrationByDate',
        method:'get',
        params:value
    })
}

// 根据id查询活动
export const getActivityById = value =>{
    return request({
        url:'/activity/getActivityById/' +value,
        method:'get',
        data:value
    })
}
// 根据id修改活动
export const updateActivityById = value =>{
    return request({
        url:'/activity/updateActivityById',
        method:'put',
        data:value
    })
}


// 添加招标
export const addTender = value =>{
    return request({
        url:'/tender/addTender',
        method:'post',
        data:value
    })
}


// 判断是否已经投过标
export const isAddBiddingByUserIdAndTenderId = value =>{
    return request({
        url:'/bidding/isAddBiddingByUserIdAndTenderId',
        method:'get',
        params:value
    })
}


export const getBiddingNum = value =>{
    return request({
        url:'/bidding/getBiddingNum',
        method:'get',
        params:value
    })
}


// 添加投标
export const addBidding = value =>{
    return request({
        url:'/bidding/addBidding',
        method:'post',
        data:value
    })
}

// 招标分页
export const getTenderByPage = value =>{
    return request({
        url:'/tender/getTenderByPage',
        method:'get',
        params:value
    })
}

// 所有招标数据
export const getAllTender = value =>{
    return request({
        url:'/tender/getAllTender',
        method:'get',
        params:value
    })
}

// 投标分页
export const getBiddingByTenderIdPage = value =>{
    return request({
        url:'/bidding/getBiddingByTenderIdPage',
        method:'get',
        params:value
    })
}

// 根据id中标
export const updateWinBidding = value =>{
    return request({
        url:'/bidding/updateWinBidding',
        method:'put',
        data:value,
    })
}

// 根据id落选
export const updateFailBidding = value =>{
    return request({
        url:'/bidding/updateFailBidding',
        method:'put',
        data:value,
    })
}



export const getTenderById = value =>{
    return request({
        url:'/tender/getTenderById/' +value,
        method:'get',
        data:value
    })
}

export const getBiddingByUserId = value =>{
    return request({
        url:'/bidding/getBiddingByUserId/' +value,
        method:'get',
        data:value
    })
}


// 根据id修改活动
export const updateTenderById = value =>{
    return request({
        url:'/tender/updateTenderById',
        method:'put',
        data:value
    })
}


// 车辆审核通过分页
export const getVehicleApplyByPagePass = value =>{
    return request({
        url:'/vehicleApproval/getVehicleApplyByPagePass',
        method:'get',
        params:value
    })
}

// 车辆审核不通过分页
export const getVehicleApplyByPageNoPass = value =>{
    return request({
        url:'/vehicleApply/getVehicleApplyByPageNoPass',
        method:'get',
        params:value
    })
}


// 车辆待审核总数
export const getVehicleApplyNum = value =>{
    return request({
        url:'/vehicleApply/getVehicleApplyNum',
        method:'get',
        params:value
    })
}



// 根据id查询申请信息
export const getVehicleApplyById = value =>{
    return request({
        url:'/vehicleApply/getVehicleApplyById/' +value,
        method:'get',
        data:value
    })
}

// 根据id查询申请信息
export const getApprovalByVeApplyId = value =>{
    return request({
        url:'/vehicleApproval/getApprovalByVeApplyId/' +value,
        method:'get',
        data:value
    })
}


// 根据id查询审批信息
export const getVehicleOneByVeApproId = value =>{
    return request({
        url:'/vehicleApproval/getVehicleOneByVeApproId/'+value,
        method:'get',
        data:value
    })
}

// 根据该用户id查询所有申请信息
export const getAllVehicleApplyByUserId = value =>{
    return request({
        url:'/vehicleApply/getAllVehicleApplyByUserId/'+value,
        method:'get',
        data:value
    })
}



// 添加车辆审批
export const addVehicleApproval = value =>{
    return request({
        url:'/vehicleApproval/addVehicleApproval',
        method:'post',
        data:value
    })
}

// 添加车辆申请
export const addVehicleApply = value =>{
    return request({
        url:'/vehicleApply/addVehicleApply',
        method:'post',
        data:value
    })
}


// 反馈未回复分页
export const getFeedbackPage = value =>{
    return request({
        url:'/feedback/getFeedbackPage',
        method:'get',
        params:value
    })
}

// 反馈已经回复分页
export const getFeedPage = value =>{
    return request({
        url:'/feedbackReply/getFeedPage',
        method:'get',
        params:value
    })
}

// 反馈已经回复分页
export const getFeedbackNum = value =>{
    return request({
        url:'/feedback/getFeedbackNum',
        method:'get',
        params:value
    })
}

// 添加回复
export const addFeedbackReply = value =>{
    return request({
        url:'/feedbackReply/addFeedbackReply',
        method:'post',
        data:value
    })
}

// 添加回复
export const addFeedback = value =>{
    return request({
        url:'/feedback/addFeedback',
        method:'post',
        data:value
    })
}


// 根据id查询反馈
export const getFeedbackById = value =>{
    return request({
        url:'/feedback/getFeedbackById/'+value,
        method:'get',
        data:value
    })
}

// 根据id查询反馈
export const getFeedByReplyId = value =>{
    return request({
        url:'/feedbackReply/getFeedByReplyId/'+value,
        method:'get',
        data:value
    })
}

// 根据用户id查询报名过的活动
export const getRegistrationByUserId = value =>{
    return request({
        url:'/registration/getRegistrationByUserId/'+value,
        method:'get',
        data:value
    })
}

// 根据registertionId查询活动详情
export const getRegistrationByRegistrationId = value =>{
    return request({
        url:'/registration/getRegistrationByRegistrationId/'+value,
        method:'get',
        data:value
    })
}


// 根据用户id查询报名过的志愿者活动
export const getVolunteerRegistrationByUserId = value =>{
    return request({
        url:'/registration/getVolunteerRegistrationByUserId/'+value,
        method:'get',
        data:value
    })
}

// 根据用户id查询反馈信息
export const getFeedByUserId = value =>{
    return request({
        url:'/feedbackReply/getFeedByUserId/'+value,
        method:'get',
        data:value
    })
}


// 根据id修改公告
export const addRegistration = value =>{
    return request({
        url:'/registration/addRegistration',
        method:'post',
        data:value,
    })
}


// 根据id修改公告
export const addRemark = value =>{
    return request({
        url:'/remark/addRemark',
        method:'post',
        data:value,
    })
}

// 根据id修改公告
export const addReply = value =>{
    return request({
        url:'/remark/addReply',
        method:'post',
        data:value,
    })
}




export const getRemarkAll = value =>{
    return request({
        url:'/remark/getRemarkAll/' + value,
        method:'get',
        data:value,
    })
}

export const getRemarkByLikeNumber = value =>{
    return request({
        url:'/remark/getRemarkByLikeNumber/' + value,
        method:'get',
        data:value
    })
}

export const getRemarkByRemarkTime = value =>{
    return request({
        url:'/remark/getRemarkByRemarkTime/' + value,
        method:'get',
        data:value
    })
}

export const getUserById = value =>{
    return request({
        url:'/user/getUserById/' + value,
        method:'get',
        data:value
    })
}

export const getRealUserById = value =>{
    return request({
        url:'/user/getRealUserById/' + value,
        method:'get',
        data:value
    })
}

export const updateUserById = value =>{
    return request({
        url:'/user/updateUserById',
        method:'put',
        params:value
    })
}

export const updatePassword = value =>{
    return request({
        url:'/user/updatePassword',
        method:'put',
        data:value
    })
}
export const updateUser = value =>{
    return request({
        url:'/user/updateUser',
        method:'put',
        data:value
    })
}


export const updateRemarkLike = value =>{
    return request({
        url:'/remark/updateRemarkLike',
        method:'put',
        params:value
    })
}


// 注册
export const register = value =>{
    return request({
        url:'/user/register',
        method:'post',
        data:value,
    })
}


// echarts
export const getRemarkCharts = value =>{
    return request({
        url:'/echarts/getRemarkCharts',
        method:'get',
        data:value,
    })
}
